Using R to Analyse and Predict Antimicrobial Resistance Rates for Isolates from Blood Cultures collected at NUTH from Q1 2019 onwards.
Newcastle upon Tyne Hospitals NHS Foundation Trust
Thursday, 6 July, 2023
Introduce R
Run through a working example of a project completed using R, exploring AMR rates in patients with diabetes
Summarise learning points with regards to choice of antibiotics in the diabetic foot
R is one of the most commonly used languages for data science, together with Python.
R is a powerful, free open source data science and statistics environment, used in industry, academia and major corporations (eg Microsoft, Google, Facebook).
R benefits from a worldwide community that freely shares learning and resources, through e.g. GitHub
The Goldacre report actively promotes the use of R in the NHS.
Mountains of data are transforming our world and have the potential to help us make better decisions.
To influence our decision-making, this data must be shaped, checked, curated, analysed, interpreted, and appropriately communicated.
This process requires people with modern data skills, working in teams, using platforms like R to do the heavy lifting.
NUTH now actively supports the use of R at scale, and it can be installed on any work PC.
Aim: Using R to Analyse and Predict Antimicrobial Resistance Rates for Blood Culture Isolates in Diabetic Patients, to influence the choice of antibiotics in the diabetic foot.
Objectives:
Import blood culture data into R
Import diabetes data into R
Wrangle, combine, visualise, and explore the data
Stratify the data by diabetic- and diabetic foot status
The laboratory information management system (LIMS) was interrogated to collect data on all culture-positive blood cultures collected between 2019-04-01 and 2023-03-31
ICD-10 coding data was analysed to determine diabetic- and diabetic foot status of all patients with culture-positive blood cultures
The AMR package [1,2] provides a standard for clean and reproducible analysis and prediction of Antimicrobial Resistance (AMR), and was used to:
determine ‘first isolates’ for use in the final analysis, as per Hindler et al [3];
calculate and visualise AMR data;
predict future AMR rates using regression models.
In total, 11098 distinct positive blood cultures were collected from 6888 distinct patients, leading to isolation of 12272 organisms.
Taking into consideration ‘first isolates’ only, 8780 distinct positive blood cultures were collected from 6888 distinct patients, leading to isolation of 9648 organisms.
From this point onwards, this analysis concentrates only on ‘first isolates’ from blood cultures, to intelligently de-duplicate the data
Since Q1 2019:
29104 distinct patients with diabetes
607 distinct patients with diabetic feet
70533 encounters
15813 patients had only a single encounter
TRUE = diabetic foot, FALSE = diabetic without diabetic foot
Age of patients with positive blood cultures
a = all blood cultures, b = patients with diabetes, c = patients with diabetic feet
R is an excellent platform for data science, including analysis and prediction of AMR rates
Patients with diabetes account for many bloodstream infections, particularly in the ED, assessment suite, and dialysis unit
Mean inpatient encounter duration is particularly prolonged for patients with diabetic foot infections
S. aureus and Proteus spp appear to cause more-than-expected morbidity in patients with diabetic feet
Resistance rates are rising, particularly to co-amoxiclav and tazocin
For Gram-positive infections, flucloxacillin remains an excellent choice
Daniel Weiand, Consultant medical microbiologist
Newcastle upon Tyne Hospitals NHS Foundation Trust
Email: dweiand@nhs.net
Twitter: @send2dan
NHS-R community blog: https://nhsrcommunity.com/author/daniel-weiand/
GitHub: send2dan